home *** CD-ROM | disk | FTP | other *** search
- ; Copyright Cornell University 1986. All rights are reserved.
- ; 9/2/87 kevin changed some names to make new compiler happy
- ; 5/25/89 kevin removed link a6, commented
-
- ; 10/13/89 kevin fixed lpos cases so spaces are skipped--10% speed increase!
- ; removed space case from zapchar for vt100 invert case
- ; added underline support for vt100
- ; speeded zapchar by eliminating clr.l & long offsets
- ; 1/22/91
- ; modified zapline/clrit for library char set so top 2 lines of
- ; font appear...
- ; 2/6/91
- ; added SwapMMUMode calls so IIci/si etc. work with 2-page displays
- ; fastscroll() & fastindex() called within emulator, so mode already OK
- ; hey, it doesn't work!
-
- public _zapchar
- public zapline
- public _zapbuf
- public _clrit
- public _clr11
- public _vtzapline
- public _fastscroll
- public _fastindex
-
- public _font
- public _boldfont
- public _invfont
- public _zapuline
- public _zapinvert
- public _skiptest
- public _chofftab9
- public _chofftab12
-
- public _long1
- public _long2
- public _long3
- public _long4
-
- public _fontarr
- public _fontskiparr
- public _skiparr
- public _allskiparr
-
- ; per window vars
- public _thefont
- public _xpos
- public _ypos
- public _modflg
- public _clrflg
- public _screenbytes
- public _screenrem
- public _startarr
- public _fontwidth
-
- ;; Copyright Cornell University 1986. All rights are reserved.
-
- cseg
-
- ; the spos# routines do the 8 variations on blanking a 6-bit wide char
- ; 8 macros which blank a space in the 8 character positions
- ; possible w/ a 6-bit wide font
-
-
- macro spos0
-
- add.w #%1,a2 ; a2 += offset
- move.w #$ffc0,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
-
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
-
- macro spos1
-
- add.w #%1,a2
- move.w #$3ff,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
- macro spos2
-
- add.w #%1,a2
- move.w #$fc0f,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
- macro spos3
-
- add.w #%1,a2
- move.l #$fff03fff,d0
- tst.b _zapinvert
- bne.s %2
-
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
-
- tst.b _zapuline
- bne lunderline
-
- rts
- %2
- eor.l #$ffffffff,d0 ; invert the clear mask
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
-
- eor.l #$ffffffff,d0 ; invert the clear mask
- tst.b _zapuline
- bne lunderline
-
- rts
- endm
-
- macro spos4
-
- add.w #%1,a2
- move.w #$c0ff,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0 ; invert the clear mask
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
- macro spos5
-
- add.w #%1,a2
- move.w #$ff03,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0 ; invert the clear mask
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
- macro spos6
-
- add.w #%1,a2
- move.l #$fffc0fff,d0
- tst.b _zapinvert
- bne.s %2
-
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
- add.w d3,a2
- and.l d0,(a2)
-
- tst.b _zapuline
- bne lunderline
-
- rts
- %2
- eor.l #$ffffffff,d0 ; invert the clear mask
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
- add.w d3,a2
- or.l d0,(a2)
-
- eor.l #$ffffffff,d0 ; invert the clear mask
- tst.b _zapuline
- bne lunderline
-
- rts
- endm
-
-
- macro spos7
-
- add.w #%1,a2
- move.w #$f03f,d0
- tst.b _zapinvert
- bne.s %2
-
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
- add.w d3,a2
- and.w d0,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- %2
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
- add.w d3,a2
- or.w d0,(a2)
-
- eor.w #$ffff,d0 ; invert the clear mask
- tst.b _zapuline
- bne underline
-
- rts
- endm
-
-
- ; the cpos# macros do the 8 variations on drawing a 6-bit wide char;
- ; the AND blanks the character position while the OR puts in the new char
- ; if zapuline is true, do an underline
-
- ; entry
- ; macro arg = bit offset from horizontal origin
- ; a0 -> font *
- ; d0 = offset of char in font
-
- ; exit
- ; a1 -> character in font
- ; a2 -> current line in bitmap
- ; d0 = mask for this char position
- ; d1 = one line of the char
-
- return:
- rts
-
- underline:
- sub.w d3,a2
- tst.b _zapinvert ; is thefont inverted?
- bne.s underclear ;
- eor.w #$ffff,d0 ; invert the clear mask
- or.w d0,(a2)
- rts
-
- underclear:
- and.w d0,(a2) ; inverted fonts get cleared
- rts
-
- lunderline: ; in this case we have a long mask
- sub.w d3,a2
- tst.b _zapinvert ; is thefont inverted?
- bne.s lunderclear ;
- eor.l #$ffffffff,d0 ; invert the clear mask
- or.l d0,(a2)
- rts
-
- lunderclear:
- and.l d0,(a2)
- rts
-
- ; the cpos macros do 12 points of a 12 pt foint
- ; >> 2
- macro cpos0
- move.l (a0),a1 ; select font *
- add.l d0,a1 ; add offset from start
-
- move.w #$ffc0,d0 ; d0 = mask
- clr.w d1
-
- add.w #%1,a2
-
- move.b (a1),d1 ; d1 = char bit row
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 2(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 4(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 6(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 8(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 10(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 12(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 14(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 16(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 18(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 20(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 22(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline ; last scan line may be an underline
-
- rts
-
- endm ; cpos0
-
- ; >> 0
- macro cpos1
- move.l 4(a0),a1
- add.l d0,a1
- move.w #$3ff,d0
-
- add.w #%1,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- endm ; cpos1
-
- ; >> 6
- macro cpos2
- move.l (a0),a1
- add.l d0,a1
- move.w #$fc0f,d0
-
- add.w #%1,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- endm ; cpos2
-
- ; << 4
- macro cpos3
- move.l 4(a0),a1
- add.l d0,a1
- move.l #$fff03fff,d0
-
- add.w #%1,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- and.l d0,(a2)
- or.l d1,(a2)
-
- tst.b _zapuline
- bne lunderline
-
- rts
- endm ; cpos3
-
- ; >> 2
- macro cpos4
- move.l (a0),a1
- add.l d0,a1
- move.w #$c0ff,d0
-
- add.w #%1,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- endm ; cpos4
-
- ; >> 0
- macro cpos5
- move.l 4(a0),a1
- add.l d0,a1
- move.w #$ff03,d0
- clr.w d1
-
- add.w #%1,a2
-
- move.b (a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 2(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 4(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 6(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 8(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 10(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 12(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 14(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 16(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 18(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 20(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 22(a1),d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- endm ; cpos5
-
- ; << 2
- macro cpos6
- move.l 4(a0),a1
- add.l d0,a1
- move.l #$fffc0fff,d0
-
- add.w #%1,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- and.l d0,(a2)
- or.l d1,(a2)
-
- tst.b _zapuline
- bne lunderline
-
- rts
- endm ; cpos6
-
- ; >> 4
- macro cpos7
- move.l (a0),a1
- add.l d0,a1
- move.w #$f03f,d0
-
- add.w #%1,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- and.w d0,(a2)
- or.w d1,(a2)
-
- tst.b _zapuline
- bne underline
-
- rts
- endm ; cpos7
-
- nomlist
-
- char0:
- cpos0 -2
-
- char1:
- cpos1 0
-
- char2:
- cpos2 0
-
- char3:
- cpos3 0
-
- char4:
- cpos4 2
-
- char5:
- cpos5 2
-
- char6:
- cpos6 2
-
- char7:
- cpos7 4
-
- char8:
- cpos0 4
-
- char9:
- cpos1 6
-
- char10:
- cpos2 6
-
- char11:
- cpos3 6
-
- char12:
- cpos4 8
-
- char13:
- cpos5 8
-
- char14:
- cpos6 8
-
- char15:
- cpos7 10
-
- char16:
- cpos0 10
-
- char17:
- cpos1 12
-
- char18:
- cpos2 12
-
- char19:
- cpos3 12
-
- char20:
- cpos4 14
-
- char21:
- cpos5 14
-
- char22:
- cpos6 14
-
- char23:
- cpos7 16
-
- char24:
- cpos0 16
-
- char25:
- cpos1 18
-
- char26:
- cpos2 18
-
- char27:
- cpos3 18
-
- char28:
- cpos4 20
-
- char29:
- cpos5 20
-
- char30:
- cpos6 20
-
- char31:
- cpos7 22
-
- char32:
- cpos0 22
-
- char33:
- cpos1 24
-
- char34:
- cpos2 24
-
- char35:
- cpos3 24
-
- char36:
- cpos4 26
-
- char37:
- cpos5 26
-
- char38:
- cpos6 26
-
- char39:
- cpos7 28
-
- char40:
- cpos0 28
-
- char41:
- cpos1 30
-
- char42:
- cpos2 30
-
- char43:
- cpos3 30
-
- char44:
- cpos4 32
-
- char45:
- cpos5 32
-
- char46:
- cpos6 32
-
- char47:
- cpos7 34
-
- char48:
- cpos0 34
-
- char49:
- cpos1 36
-
- char50:
- cpos2 36
-
- char51:
- cpos3 36
-
- char52:
- cpos4 38
-
- char53:
- cpos5 38
-
- char54:
- cpos6 38
-
- char55:
- cpos7 40
-
- char56:
- cpos0 40
-
- char57:
- cpos1 42
-
- char58:
- cpos2 42
-
- char59:
- cpos3 42
-
- char60:
- cpos4 44
-
- char61:
- cpos5 44
-
- char62:
- cpos6 44
-
- char63:
- cpos7 46
-
- char64:
- cpos0 46
-
- char65:
- cpos1 48
-
- char66:
- cpos2 48
-
- char67:
- cpos3 48
-
- char68:
- cpos4 50
-
- char69:
- cpos5 50
-
- char70:
- cpos6 50
-
- char71:
- cpos7 52
-
- char72:
- cpos0 52
-
- char73:
- cpos1 54
-
- char74:
- cpos2 54
-
- char75:
- cpos3 54
-
- char76:
- cpos4 56
-
- char77:
- cpos5 56
-
- char78:
- cpos6 56
-
- char79:
- cpos7 58
-
-
- ; case is the jump table for zapchar
-
- case_:
- dc.l char0
- dc.l char1
- dc.l char2
- dc.l char3
- dc.l char4
- dc.l char5
- dc.l char6
- dc.l char7
- dc.l char8
- dc.l char9
- dc.l char10
- dc.l char11
- dc.l char12
- dc.l char13
- dc.l char14
- dc.l char15
- dc.l char16
- dc.l char17
- dc.l char18
- dc.l char19
- dc.l char20
- dc.l char21
- dc.l char22
- dc.l char23
- dc.l char24
- dc.l char25
- dc.l char26
- dc.l char27
- dc.l char28
- dc.l char29
- dc.l char30
- dc.l char31
- dc.l char32
- dc.l char33
- dc.l char34
- dc.l char35
- dc.l char36
- dc.l char37
- dc.l char38
- dc.l char39
- dc.l char40
- dc.l char41
- dc.l char42
- dc.l char43
- dc.l char44
- dc.l char45
- dc.l char46
- dc.l char47
- dc.l char48
- dc.l char49
- dc.l char50
- dc.l char51
- dc.l char52
- dc.l char53
- dc.l char54
- dc.l char55
- dc.l char56
- dc.l char57
- dc.l char58
- dc.l char59
- dc.l char60
- dc.l char61
- dc.l char62
- dc.l char63
- dc.l char64
- dc.l char65
- dc.l char66
- dc.l char67
- dc.l char68
- dc.l char69
- dc.l char70
- dc.l char71
- dc.l char72
- dc.l char73
- dc.l char74
- dc.l char75
- dc.l char76
- dc.l char77
- dc.l char78
- dc.l char79
-
- space0:
- spos0 -2,sp0
- space1:
- spos1 0,sp1
- space2:
- spos2 0,sp2
- space3:
- spos3 0,sp3
- space4:
- spos4 2,sp4
- space5:
- spos5 2,sp5
- space6:
- spos6 2,sp6
- space7:
- spos7 4,sp7
- space8:
- spos0 4,sp8
- space9:
- spos1 6,sp9
- space10:
- spos2 6,sp10
- space11:
- spos3 6,sp11
- space12:
- spos4 8,sp12
- space13:
- spos5 8,sp13
- space14:
- spos6 8,sp14
- space15:
- spos7 10,sp15
- space16:
- spos0 10,sp16
- space17:
- spos1 12,sp17
- space18:
- spos2 12,sp18
- space19:
- spos3 12,sp19
- space20:
- spos4 14,sp20
- space21:
- spos5 14,sp21
- space22:
- spos6 14,sp22
- space23:
- spos7 16,sp23
- space24:
- spos0 16,sp24
- space25:
- spos1 18,sp25
- space26:
- spos2 18,sp26
- space27:
- spos3 18,sp27
- space28:
- spos4 20,sp28
- space29:
- spos5 20,sp29
- space30:
- spos6 20,sp30
- space31:
- spos7 22,sp31
- space32:
- spos0 22,sp32
- space33:
- spos1 24,sp33
- space34:
- spos2 24,sp34
- space35:
- spos3 24,sp35
- space36:
- spos4 26,sp36
- space37:
- spos5 26,sp37
- space38:
- spos6 26,sp38
- space39:
- spos7 28,sp39
- space40:
- spos0 28,sp40
- space41:
- spos1 30,sp41
- space42:
- spos2 30,sp42
- space43:
- spos3 30,sp43
- space44:
- spos4 32,sp44
- space45:
- spos5 32,sp45
- space46:
- spos6 32,sp46
- space47:
- spos7 34,sp47
- space48:
- spos0 34,sp48
- space49:
- spos1 36,sp49
- space50:
- spos2 36,sp50
- space51:
- spos3 36,sp51
- space52:
- spos4 38,sp52
- space53:
- spos5 38,sp53
- space54:
- spos6 38,sp54
- space55:
- spos7 40,sp55
- space56:
- spos0 40,sp56
- space57:
- spos1 42,sp57
- space58:
- spos2 42,sp58
- space59:
- spos3 42,sp59
- space60:
- spos4 44,sp60
- space61:
- spos5 44,sp61
- space62:
- spos6 44,sp62
- space63:
- spos7 46,sp63
- space64:
- spos0 46,sp64
- space65:
- spos1 48,sp65
- space66:
- spos2 48,sp66
- space67:
- spos3 48,sp67
- space68:
- spos4 50,sp68
- space69:
- spos5 50,sp69
- space70:
- spos6 50,sp70
- space71:
- spos7 52,sp71
- space72:
- spos0 52,sp72
- space73:
- spos1 54,sp73
- space74:
- spos2 54,sp74
- space75:
- spos3 54,sp75
- space76:
- spos4 56,sp76
- space77:
- spos5 56,sp77
- space78:
- spos6 56,sp78
- space79:
- spos7 58,sp79
-
- case1_:
- dc.l space0
- dc.l space1
- dc.l space2
- dc.l space3
- dc.l space4
- dc.l space5
- dc.l space6
- dc.l space7
- dc.l space8
- dc.l space9
- dc.l space10
- dc.l space11
- dc.l space12
- dc.l space13
- dc.l space14
- dc.l space15
- dc.l space16
- dc.l space17
- dc.l space18
- dc.l space19
- dc.l space20
- dc.l space21
- dc.l space22
- dc.l space23
- dc.l space24
- dc.l space25
- dc.l space26
- dc.l space27
- dc.l space28
- dc.l space29
- dc.l space30
- dc.l space31
- dc.l space32
- dc.l space33
- dc.l space34
- dc.l space35
- dc.l space36
- dc.l space37
- dc.l space38
- dc.l space39
- dc.l space40
- dc.l space41
- dc.l space42
- dc.l space43
- dc.l space44
- dc.l space45
- dc.l space46
- dc.l space47
- dc.l space48
- dc.l space49
- dc.l space50
- dc.l space51
- dc.l space52
- dc.l space53
- dc.l space54
- dc.l space55
- dc.l space56
- dc.l space57
- dc.l space58
- dc.l space59
- dc.l space60
- dc.l space61
- dc.l space62
- dc.l space63
- dc.l space64
- dc.l space65
- dc.l space66
- dc.l space67
- dc.l space68
- dc.l space69
- dc.l space70
- dc.l space71
- dc.l space72
- dc.l space73
- dc.l space74
- dc.l space75
- dc.l space76
- dc.l space77
- dc.l space78
- dc.l space79
-
-
- _zapchar:
- move.w _ypos,d0
- lsl.w #2,d0
- move.l _startarr,a2 ; a2 = *(startarr + ypos)
- move.l (a2,d0.w),a2 ; a2 -> addr of 1'st scan line
-
- move.w 4(a7),d0 ; d0 = thechar
- move.w _xpos,d1 ; d1 = xpos
- move.w _fontwidth,d2
- move.w _screenbytes,d3 ; # of bytes in screen row
-
- lea _skiparr,a1 ; use optimized space drawing routine
- tst.b (a1,d0.w) ; if the character is a space
- bne.s space
-
- move.l _thefont,a0 ; 0(a0) -> table 1 4(a0) -> table 2
-
- cmp.w #8,d2
- beq.s zapbigfont
-
- zapsmallfont:
- lsl.w #2,d1 ; xpos index into character jump table
- add.w d0,d0 ; d0 -> 2 * (the character)
- move.l _chofftab9,a1 ; a1 -> character offset table
- move.w (a1,d0.w),d0 ; d0 = byte offset from font start
-
- lea case_,a1 ; branch to the correct character
- move.l (a1,d1.w),a1 ; drawing routine
- jmp (a1) ;
-
- space:
- cmp.w #8,d2
- beq.s zapbigspos
-
- smallspace:
- lsl.w #2,d1 ; xpos index into character jump table
- lea case1_,a1 ; branch to the correct character
- move.l (a1,d1.w),a1 ; drawing routine
- jmp (a1) ;
-
-
-
- ; bigcpos & bigspos handle 8-bit wide characters & spaces
-
- ; a0 -> font
- ; a1 -> font
- ; a2 -> dest linestart
- ; d0 = char
- ; d1 = xpos
- ; d3 = screen line width in bytes
-
- zapbigfont:
- add.w d1,a2 ; a2 -> char pos on screen
- add.w d0,d0 ; d0 = 2 * (the character)
- move.l _chofftab12,a1 ; a1 -> character offset table
- move.w (a1,d0.w),d0 ; d0 = byte offset from font start
-
- ; and fall through...
-
- ; a0 -> current font
- ; a1 -> char in font
- ; a2 -> dest
- ; d3 = screen line width in bytes
-
- ; TODO roll up the loop for more flexibility?
-
- bigcpos:
- move.l 8(a0),a1 ; a1 -> font3
- add.w d0,a1 ; a1 -> char top in font
-
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2) ; 14th line
-
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2
- move.b (a1),(a2)
- add.w #2,a1
- add.w d3,a2 ; 19
- move.b (a1),(a2)
-
- tst.b _zapuline
- bne bigunderline ; last scan line may be an underline
-
- rts
-
- zapbigspos:
- add.w d1,a2 ; a2 -> char pos on screen
-
- bigspos:
- ; for 8 X 14 font, 8 X 19 substituted currently
- tst.b _zapinvert
- bne.s biginvert
-
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2) ; 14th line
-
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2)
- add.w d3,a2
- clr.b (a2) ; 19th line
-
- tst.b _zapuline
- bne.s bigunderline
-
- rts
-
- biginvert:
- move.b #$ff,d0 ; invert the clear mask
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2) ; 14
-
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2)
- add.w d3,a2
- move.b d0,(a2) ; 19
-
- tst.b _zapuline
- bne.s bigunderline
-
- rts
-
- bigunderline:
- sub.w d3,a2 ; back up a couple of scan lines
- sub.w d3,a2
- sub.w d3,a2
- tst.b _zapinvert ; is thefont inverted?
- bne.s bigunderclear ;
- move.b #$ff,(a2) ; invert the clear mask
- rts
-
- bigunderclear:
- clr.b (a2) ; inverted fonts get cleared
- rts
-
-
- ; a0 -> multiplication table
- ; a1 -> font rows
- ; a2 -> linestart
- ; a3 -> screen map
- ; a4 -> font
- ; a5 -> globals
-
- ; d0 = the character
- ; d1 = bit row, counter for chk_attr
- ; d2 = modflg
- ; d3-d7 used by clrit
-
- ; needs inside character loop to be screen portable:
- ; d3 = screen byte width
- ; d4 saves a2
-
- savregs: reg a3/a4/d4-d7
-
- _zapbuf:
- link a6,#0
- movem.l savregs,-(sp)
-
- ; dc.w $a9ff
- ; move.w #1,d0
- ; dc.w $a05d ; SwapMMUMode to 32-bit
- ; move.w d0,-(sp) ; save current mode on stack
-
- move.l 8(a6),a3 ; a3 -> 3270 screen map
- move.l _thefont,a4 ; 0(a4) -> table 1 4(a4) -> table 2
- cmp.l #0,a4
- beq.s nullfont
- lea _skiparr,a1
- move.l a1,_skiptest ; if font != NULL, skiptest = skiparr
- bra.s fontcont
-
- nullfont:
- lea _allskiparr,a1
- move.l a1,_skiptest ; else skiptest = allskiparr
-
- fontcont:
- move.w _screenbytes,d3 ; bytes in screen width
-
- move.l _clrflg,d2 ; d2 = line clear flag
- move.l _modflg,d1
- btst #0,d1
- beq.s skip0
-
- move.w _fontwidth,d5
- cmp.w #8,d5
- bne.s smallfont
-
- ; TODO this routine does not yet work, but could speed up
- ; the large font...
-
- bufbigfont:
- move.l _thefont,a0 ; 0(a0) -> font table
- move.l #$80000000,d6 ; d6 = line bit index to set/test flags
- move.w #24,_long1 ; # of lines
- move.w #$FFFC,_long3 ; _long3 = offset in startarr
- ; set up for pre increment
-
- bigloop:
- sub.w #1,_long1
- blt.s bigexit
-
- add.w #4,_long3 ; increment startarr offset
- rol.l #1,d6 ; shift the test bit up
- move.l d6,d4 ; d4 = current line bit
- and.l _modflg,d4 ; test to see if modified
- bne.s dobigdraw
-
- ; no need to draw, but must check for font change
-
- move.l a0,a4 ; a4 -> current font
- jsr chk_attr
- move.l a4,a0 ; a0 -> font (chk_attr may modify a4)
- bra.s bigloop
-
- dobigdraw:
- move.l d6,d4 ; d4 = current line bit
- and.l d2,d4 ; d4 = cleared?
- clr.w d5 ; line touched by draw?
- move.w #$ffff,d7 ; d7 = xpos, set up for preincrement
- move.w #80,_long2 ; char count
-
- biglinedraw:
- sub.w #1,_long2
- blt.s biglinedrawexit
-
- add.w #1,d7 ; increment xpos for offset
-
- clr.w d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s abigchar
-
- abigattr:
- and.b #$c,d0 ; mask the attribute byte
- lea _fontarr,a1 ; a1 -> font * array
- lsl.w #2,d0 ; offset in array = d0 * 4
- move.l (a1,d0.w),a0 ; a0 -> font from array
-
- lea _fontskiparr,a1 ; a1 -> array of ptrs to skiparr or allskiparr
- move.l (a1,d0.w),_skiptest ; skiptest -> correct skiparr
-
- move.w #32,d0 ; fall through to put out a space
-
- abigchar:
- tst.l d4 ; was line cleared?
- beq.s drawbigchar ; if not draw all chars
-
- move.l _skiptest,a1
- tst.b (a1,d0.l) ; skip spaces if clear line
- bne.s biglinedraw
-
- drawbigchar:
- move.l _startarr,a2 ; a2 -> line start array
- add.w _long3,a2 ; a2 -> line start array entry
- move.l (a2),a2 ; a2 -> line start
- add.w d7,a2 ; a2 -> character top in line
-
- st d5 ; d5 = character was drawn
- add.w d0,d0 ; d0 -> 2 * (scanlines/char) * (the character)
- move.l _chofftab12,a1 ; a1 -> character offset table
- move.w (a1,d0.w),d0 ; d0 = byte offset from font start
-
- jsr bigcpos
- bra biglinedraw
-
- biglinedrawexit:
- tst.b d5
- beq.s nottouched
- neg.l d4 ; complement of d4
- and.l d4,d2 ; update the clear flag
- nottouched:
- bra bigloop
-
- bigexit:
- move.l d2,_clrflg ; reset line clear flag
- clr.l _modflg ; all modified lines are out
-
- ; move.w (sp)+,d0
- ; dc.w $a05d ; SwapMMUMode to restore previous mode
-
- movem.l (sp)+,savregs
- unlk a6
- rts
-
- smallfont:
- ; zapbuf-draw a 9 pt font
-
- move.l _startarr,a2
- move.l (a2),a2 ; a2 -> screen display line 0
- ; add.w d3,a2 ; skip top two lines
- ; add.w d3,a2
-
- bclr #0,d2
- bne.s skipc0
- jsr _clrit
- skipc0:
- jsr zapline
- bra do1
-
- skip0:
- jsr chk_attr
-
- do1:
- move.l _modflg,d1
- btst #1,d1
- beq.s skip1
- move.l _startarr,a2
- move.l 4(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #1,d2
- bne.s skipc1
- jsr _clrit
- skipc1:
- jsr zapline
- bra do2
-
- skip1:
- jsr chk_attr
-
- do2:
- move.l _modflg,d1
- btst #2,d1
- beq.s skip2
- move.l _startarr,a2
- move.l 8(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #2,d2
- bne.s skipc2
- jsr _clrit
- skipc2:
- jsr zapline
- bra do3
-
- skip2:
- jsr chk_attr
-
- do3:
- move.l _modflg,d1
- btst #3,d1
- beq.s skip3
- move.l _startarr,a2
- move.l 12(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #3,d2
- bne.s skipc3
- jsr _clrit
- skipc3:
- jsr zapline
- bra do4
- skip3:
- jsr chk_attr
-
- do4:
- move.l _modflg,d1
- btst #4,d1
- beq.s skip4
- move.l _startarr,a2
- move.l 16(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #4,d2
- bne.s skipc4
- jsr _clrit
- skipc4:
- jsr zapline
- bra do5
-
- skip4:
- jsr chk_attr
-
- do5:
- move.l _modflg,d1
- btst #5,d1
- beq.s skip5
- move.l _startarr,a2
- move.l 20(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #5,d2
- bne.s skipc5
- jsr _clrit
- skipc5:
- jsr zapline
- bra do6
-
- skip5:
- jsr chk_attr
-
- do6:
- move.l _modflg,d1
- btst #6,d1
- beq.s skip6
- move.l _startarr,a2
- move.l 24(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #6,d2
- bne.s skipc6
- jsr _clrit
- skipc6:
- jsr zapline
- bra do7
-
- skip6:
- jsr chk_attr
-
- do7:
- move.l _modflg,d1
- btst #7,d1
- beq.s skip7
- move.l _startarr,a2
- move.l 28(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #7,d2
- bne.s skipc7
- jsr _clrit
- skipc7:
- jsr zapline
- bra do8
-
- skip7:
- jsr chk_attr
-
- do8:
- move.l _modflg,d1
- btst #8,d1
- beq.s skip8
- move.l _startarr,a2
- move.l 32(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #8,d2
- bne.s skipc8
- jsr _clrit
- skipc8:
- jsr zapline
- bra do9
-
- skip8:
- jsr chk_attr
-
- do9:
- move.l _modflg,d1
- btst #9,d1
- beq.s skip9
- move.l _startarr,a2
- move.l 36(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #9,d2
- bne.s skipc9
- jsr _clrit
- skipc9:
- jsr zapline
- bra do10
-
- skip9:
- jsr chk_attr
-
- do10:
- move.l _modflg,d1
- btst #10,d1
- beq.s skip10
- move.l _startarr,a2
- move.l 40(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #10,d2
- bne.s skipc10
- jsr _clrit
- skipc10:
- jsr zapline
- bra do11
-
- skip10:
- jsr chk_attr
-
- do11:
- move.l _modflg,d1
- btst #11,d1
- beq.s skip11
- move.l _startarr,a2
- move.l 44(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #11,d2
- bne.s skipc11
- jsr _clrit
- skipc11:
- jsr zapline
- bra do12
-
- skip11:
- jsr chk_attr
-
- do12:
- move.l _modflg,d1
- btst #12,d1
- beq.s skip12
- move.l _startarr,a2
- move.l 48(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #12,d2
- bne.s skipc12
- jsr _clrit
- skipc12:
- jsr zapline
- bra do13
-
- skip12:
- jsr chk_attr
-
- do13:
- move.l _modflg,d1
- btst #13,d1
- beq.s skip13
- move.l _startarr,a2
- move.l 52(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #13,d2
- bne.s skipc13
- jsr _clrit
- skipc13:
- jsr zapline
- bra do14
-
- skip13:
- jsr chk_attr
-
- do14:
- move.l _modflg,d1
- btst #14,d1
- beq.s skip14
- move.l _startarr,a2
- move.l 56(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #14,d2
- bne.s skipc14
- jsr _clrit
- skipc14:
- jsr zapline
- bra do15
-
- skip14:
- jsr chk_attr
-
- do15:
- move.l _modflg,d1
- btst #15,d1
- beq.s skip15
- move.l _startarr,a2
- move.l 60(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #15,d2
- bne.s skipc15
- jsr _clrit
- skipc15:
- jsr zapline
- bra do16
-
- skip15:
- jsr chk_attr
-
- do16:
- move.l _modflg,d1
- btst #16,d1
- beq.s skip16
- move.l _startarr,a2
- move.l 64(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #16,d2
- bne.s skipc16
- jsr _clrit
- skipc16:
- jsr zapline
- bra do17
-
- skip16:
- jsr chk_attr
-
- do17:
- move.l _modflg,d1
- btst #17,d1
- beq.s skip17
- move.l _startarr,a2
- move.l 68(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #17,d2
- bne.s skipc17
- jsr _clrit
- skipc17:
- jsr zapline
- bra do18
-
- skip17:
- jsr chk_attr
-
- do18:
- move.l _modflg,d1
- btst #18,d1
- beq.s skip18
- move.l _startarr,a2
- move.l 72(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #18,d2
- bne.s skipc18
- jsr _clrit
- skipc18:
- jsr zapline
- bra do19
-
- skip18:
- jsr chk_attr
-
- do19:
- move.l _modflg,d1
- btst #19,d1
- beq.s skip19
- move.l _startarr,a2
- move.l 76(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #19,d2
- bne.s skipc19
- jsr _clrit
- skipc19:
- jsr zapline
- bra do20
-
- skip19:
- jsr chk_attr
-
- do20:
- move.l _modflg,d1
- btst #20,d1
- beq.s skip20
- move.l _startarr,a2
- move.l 80(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #20,d2
- bne.s skipc20
- jsr _clrit
- skipc20:
- jsr zapline
- bra do21
-
- skip20:
- jsr chk_attr
-
- do21:
- move.l _modflg,d1
- btst #21,d1
- beq.s skip21
- move.l _startarr,a2
- move.l 84(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #21,d2
- bne.s skipc21
- jsr _clrit
- skipc21:
- jsr zapline
- bra do22
-
- skip21:
- jsr chk_attr
-
- do22:
- move.l _modflg,d1
- btst #22,d1
- beq.s skip22
- move.l _startarr,a2
- move.l 88(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #22,d2
- bne.s skipc22
- jsr _clrit
- skipc22:
- jsr zapline
- bra do23
-
- skip22:
- jsr chk_attr
-
- do23:
- move.l _modflg,d1
- btst #23,d1
- beq.s skip23
- move.l _startarr,a2
- move.l 92(a2),a2 ; a2 -> screen display line 1
- ; add.w d3,a2
- ; add.w d3,a2
-
- bclr #23,d2
- bne.s skipc23
- jsr _clrit
- skipc23:
- jsr zapline
-
- skip23:
- move.l d2,_clrflg ; reset line clear flag
- clr.l _modflg ; all modified lines are out
-
- ; move.w (sp)+,d0
- ; dc.w $a05d ; SwapMMUMode to restore previous mode
-
- movem.l (sp)+,savregs
- unlk a6
- rts
-
-
- chk_attr:
- move.w #79,d7
- clr.w d0
-
- tst_attr:
- move.b (a3)+,d0 ; a3 -> chars in scr_map
- cmpi.w #32,d0
- dblt d7,tst_attr ; if char < 32, continue
-
- tst.w d7
- bge.s isattr ; if d7 < 0 we hit the end of the line
- rts
- isattr
- and.b #$c,d0 ; mask the attribute byte
- lea _fontarr,a1 ; a1 -> font * array
- lsl.w #2,d0 ; offset in array = d0 * 4
- move.l (a1,d0.w),a4 ; a4 -> font from array
-
- lea _fontskiparr,a1 ; a1 -> array of ptrs to skiparr or allskiparr
- move.l (a1,d0.w),_skiptest ; skiptest -> correct skiparr
-
- dbra d7,tst_attr ; continue
- rts
-
-
- ; zapline related routines follow
- ; the lpos# macros do the 8 variations on drawing a 6-bit wide char within a line
- ; macro arg = bit offset from a2
- ; a2 -> starting pos of line on screen
- ; a3 -> character array
- ; a4 -> font
-
- ; uses d0 = offset of char in font
-
- ; $0C is the mask for display detectable
- ; $00 = normal/not pen detectable
- ; $04 = normal/detectable
- ; $08 = bold/detectable
- ; $0C = invisible/not detectable
-
- ; first check to see if this char is an attribute
- ; if so reset the font ptr & skip drawing
- ; else draw character
-
- macro lpos0
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0 ; mask the attribute byte
- lea _fontarr,a1 ; a1 -> font * array
- lsl.w #2,d0 ; offset in array = d0 * 4
- move.l (a1,d0.w),a4 ; a4 -> font from array
-
- lea _fontskiparr,a1 ; a1 -> array of ptrs to skiparr or allskiparr
- move.l (a1,d0.w),_skiptest ; skiptest -> correct skiparr
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l) ; skip spaces
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0 ; kevin skip first two lines of font
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l (a4),a1
- add.l d0,a1
- clr.w d1
-
- move.b (a1),d1
- or.w d1,(a2)
- add.w d3,a2 ; end first group
- move.b 2(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 4(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 6(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 8(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 10(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 12(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 14(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 16(a1),d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
- move.b 18(a1),d1
- or.w d1,(a2)
- add.w d3,a2
- move.b 20(a1),d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
-
- macro lpos1
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l) ; skip spaces
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l 4(a4),a1
- add.l d0,a1
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
-
- macro lpos2
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l (a4),a1
- add.l d0,a1
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #4,d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- macro lpos3
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l 4(a4),a1
- add.l d0,a1
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #4,d1
- or.l d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- macro lpos4
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l (a4),a1
- add.l d0,a1
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- move.w (a1)+,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- macro lpos5
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l 4(a4),a1
- add.l d0,a1
- clr.w d1
-
- move.b (a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 2(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 4(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 6(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 8(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 10(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 12(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 14(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 16(a1),d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- move.b 18(a1),d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.b 20(a1),d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- macro lpos6
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l 4(a4),a1
- add.l d0,a1
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
- add.w d3,a2
-
- clr.l d1
- move.w (a1)+,d1
- lsl.l #2,d1
- or.l d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- macro lpos7
-
- clr.l d0
- move.b (a3)+,d0
- cmpi.w #32,d0
- bge.s %2
-
- and.b #$c,d0
- lea _fontarr,a1
- lsl.w #2,d0
- move.l (a1,d0.w),a4
-
- lea _fontskiparr,a1
- move.l (a1,d0.w),_skiptest
-
- bra %3
-
- %2:
- move.l _skiptest,a1
- tst.b (a1,d0.l)
- bne.s %3
-
- lsl.l #1,d0
- move.l _chofftab9,a1
- move.w (a1,d0.l),d0
- ; add.w #4,d0
-
- move.l a2,d4
- add.w #%1,a2
-
- move.l (a4),a1
- add.l d0,a1
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2 ; add. 2 lines
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
- add.w d3,a2
-
- move.w (a1)+,d1
- lsr.w #2,d1
- or.w d1,(a2)
-
- move.l d4,a2
- %3:
- endm
-
- zapline:
- lpos0 -2,l1,s1
- lpos1 0,l2,s2
- lpos2 0,l3,s3
- lpos3 0,l4,s4
- lpos4 2,l5,s5
- lpos5 2,l6,s6
- lpos6 2,l7,s7
- lpos7 4,l8,s8
- lpos0 4,l9,s9
- lpos1 6,l10,s10
- lpos2 6,l11,s11
- lpos3 6,l12,s12
- lpos4 8,l13,s13
- lpos5 8,l14,s14
- lpos6 8,l15,s15
- lpos7 10,l16,s16
- lpos0 10,l17,s17
- lpos1 12,l18,s18
- lpos2 12,l19,s19
- lpos3 12,l20,s20
- lpos4 14,l21,s21
- lpos5 14,l22,s22
- lpos6 14,l23,s23
- lpos7 16,l24,s24
- lpos0 16,l25,s25
- lpos1 18,l26,s26
- lpos2 18,l27,s27
- lpos3 18,l28,s28
- lpos4 20,l29,s29
- lpos5 20,l30,s30
- lpos6 20,l31,s31
- lpos7 22,l32,s32
- lpos0 22,l33,s33
- lpos1 24,l34,s34
- lpos2 24,l35,s35
- lpos3 24,l36,s36
- lpos4 26,l37,s37
- lpos5 26,l38,s38
- lpos6 26,l39,s39
- lpos7 28,l40,s40
- lpos0 28,l41,s41
- lpos1 30,l42,s42
- lpos2 30,l43,s43
- lpos3 30,l44,s44
- lpos4 32,l45,s45
- lpos5 32,l46,s46
- lpos6 32,l47,s47
- lpos7 34,l48,s48
- lpos0 34,l49,s49
- lpos1 36,l50,s50
- lpos2 36,l51,s51
- lpos3 36,l52,s52
- lpos4 38,l53,s53
- lpos5 38,l54,s54
- lpos6 38,l55,s55
- lpos7 40,l56,s56
- lpos0 40,l57,s57
- lpos1 42,l58,s58
- lpos2 42,l59,s59
- lpos3 42,l60,s60
- lpos4 44,l61,s61
- lpos5 44,l62,s62
- lpos6 44,l63,s63
- lpos7 46,l64,s64
- lpos0 46,l65,s65
- lpos1 48,l66,s66
- lpos2 48,l67,s67
- lpos3 48,l68,s68
- lpos4 50,l69,s69
- lpos5 50,l70,s70
- lpos6 50,l71,s71
- lpos7 52,l72,s72
- lpos0 52,l73,s73
- lpos1 54,l74,s74
- lpos2 54,l75,s75
- lpos3 54,l76,s76
- lpos4 56,l77,s77
- lpos5 56,l78,s78
- lpos6 56,l79,s79
- lpos7 58,l80,s80
-
- rts
-
-
- ; clear an 12 scan line font
-
- b160: reg d3-d7
- b128: reg d4-d7
-
- _clr11:
- _clrit:
-
- move.l a2,a0
-
- move.w #$ffc0,d0
- move.l #$03f,d1
-
- clr.l d3
- clr.l d4
- clr.l d5
- clr.l d6
- clr.l d7
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- ; bra clrcont
-
- ; clear an 9 scan line font
-
- ;_clrit:
- ; move.l a2,a0
-
- ; move.w #$ffc0,d0
- ; move.l #$03f,d1
-
- ; clr.l d3
- ; clr.l d4
- ; clr.l d5
- ; clr.l d6
- ; clr.l d7
-
- ;clrcont:
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
- tst.l (a0)+
- add.w _screenrem,a0
-
- and.w d0,-2(a0)
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b160,(a0)
- add.l #20,a0
- movem.l b128,(a0)
- add.l #16,a0
- and.l d1,(a0)+
-
- move.w _screenbytes,d3 ; restore bytes in screen width
- rts
-
-
- scrollregs: reg a3/d4-d7
-
- ; kevin eric saunders
- ; scrolls a 19 pt font including all lines
-
- _fastindex
-
- ; fastindex(dest, src, count);
-
- link a6,#0
-
- movem.l scrollregs,-(sp) ;; push regs (aztec c uses)
-
- move.l 8(a6),a2 ;; a2 -> target to be obliterated
- move.l 12(a6),a3 ;; a3 -> source
- move.w 16(a6),d1 ;; d1 = # of lines to move
- sub.w #1,d1 ;; predecrement for dbra
-
- move.w _fontwidth,d2
- cmp.w #8,d2 ;; 8 bits wide?
- bne.s _index11 ;; do the 6 bit routine
-
- _index19
-
- move.l #18,d0 ;; # of scan lines per line, predecremented for dbra
- move.w #38,d2 ;; # of lines to back up each time
- mulu _screenbytes,d2 ;; # of bytes required
-
- index19dupline:
-
- ; move the line
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- ; wrap to the next line
- add.w _screenrem,a2
- add.w _screenrem,a3
- sub.w #16,a2 ; fix screenrem for 80 byte wide screen
- sub.w #16,a3
-
- dbra d0,index19dupline
-
- ; this is dumb but it will work: back up to copy the next line down
- sub.w d2,a2
- sub.w d2,a3
-
- move.l #18,d0 ;; # of scan lines to move, predecremented for dbra
-
- dbra d1,index19dupline
-
- jsr _clr19 ;; a2 = scan line to erase
-
- movem.l (sp)+,scrollregs ;; pop regs
-
- unlk a6
- rts
-
-
- ; indexes an 12 pt font including everything
-
- _index11
-
- move.l #11,d0 ;; # of scan lines per line, predecremented for dbra
- sub.l #2,a2 ;; correct for shift on the screen
- sub.l #2,a3 ;; correct for shift on the screen
-
- indexdupline:
-
- ;; fix the first word which has irrelevant stuff
- movem.l (a3)+,b160 ;; grab the first bunch from below
- andi.l #$3fffff,d3 ;; mask off the left end
- move.l (a2),d2 ;; get the first word to mask
- and.l #$ffc00000,d2 ;; mask off the right end
- or.l d2,d3 ;; now combine them
- movem.l b160,(a2) ;; and move them up
- add.l #20,a2
-
- ;; now do the middle, no masking needed
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- ;; and then do the word at the end, masking the right end of it
- move.w (a2),d2
- andi.w #$3f,d2
- move.w (a3)+,d3
- andi.w #$ffc0,d3
- or.w d2,d3
- move.w d3,(a2)+
-
- ;; step around the next word to the beginning of the next line
- addq.l #2,a2
- addq.l #2,a3
-
- add.w _screenrem,a2
- add.w _screenrem,a3
-
- dbra d0,indexdupline
-
- ; this is dumb but it will work: index up to copy the next line down
- move.w #24,d2 ;; # of lines to back up each time
- mulu _screenbytes,d2 ;; # of bytes required
- sub.w d2,a2
- sub.w d2,a3
-
- move.l #11,d0 ;; # of scan lines to move, predecremented for dbra
-
- dbra d1,indexdupline
-
- add.l #2,a2 ;; un-correct screen shift
- jsr _clr11 ;; wants cleared regs, a2 = scan line to erase
-
- movem.l (sp)+,scrollregs ;; pop regs
-
- unlk a6
- rts
-
-
-
- _fastscroll
-
- ; fastscroll(dest, src, count);
-
- link a6,#0
-
- movem.l scrollregs,-(sp) ;; push regs (aztec c uses)
-
- move.l 8(a6),a2 ;; a2 -> target to be obliterated
- move.l 12(a6),a3 ;; a3 -> source
- move.w 16(a6),d1 ;; d1 = # of lines to move
- sub.w #1,d1 ;; predecrement for dbra
-
- move.w _fontwidth,d2
- cmp.w #8,d2 ;; 8 bits wide?
- bne.s _scroll11 ;; do the 6 bit routine
-
- _scroll19
-
- move.l #18,d0 ;; # of scan lines per line, predecremented for dbra
-
- scr19dupline:
-
- ; move the line
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- ; wrap to the next line
- add.w _screenrem,a2
- add.w _screenrem,a3
- sub.w #16,a2 ; fix screenrem for 80 byte wide screen
- sub.w #16,a3
-
- dbra d0,scr19dupline
-
- move.l #18,d0 ;; # of scan lines to move, predecremented for dbra
-
- dbra d1,scr19dupline
-
- jsr _clr19 ;; a2 = scan line to erase
-
- movem.l (sp)+,scrollregs ;; pop regs
-
- unlk a6
- rts
-
-
- ; clears the last line for a 19 pt font
-
- _clr19
-
- clr.l d3
- clr.l d4
- clr.l d5
- clr.l d6
- clr.l d7
-
- move.l #18,d0 ;; # of scan lines per line, predecremented for dbra
-
- scrclrline:
-
- ; clear the line
- movem.l b160,(a2)
- add.l #20,a2
- movem.l b160,(a2)
- add.l #20,a2
- movem.l b160,(a2)
- add.l #20,a2
- movem.l b160,(a2)
- add.l #20,a2
-
- ; wrap to the next line
- add.w _screenrem,a2
- sub.w #16,a2 ; fix screenrem for 80 byte wide
-
- dbra d0,scrclrline
-
- rts
-
-
- ; scrolls an 12 pt font including everything
-
- _scroll11
-
- move.l #11,d0 ;; # of scan lines per line, predecremented for dbra
- sub.l #2,a2 ;; correct for shift on the screen
- sub.l #2,a3 ;; correct for shift on the screen
-
- scrdupline:
-
- ;; fix the first word which has irrelevant stuff
- movem.l (a3)+,b160 ;; grab the first bunch from below
- andi.l #$3fffff,d3 ;; mask off the left end
- move.l (a2),d2 ;; get the first word to mask
- and.l #$ffc00000,d2 ;; mask off the right end
- or.l d2,d3 ;; now combine them
- movem.l b160,(a2) ;; and move them up
- add.l #20,a2
-
- ;; now do the middle, no masking needed
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- movem.l (a3)+,b160
- movem.l b160,(a2)
- add.l #20,a2
-
- ;; and then do the word at the end, masking the right end of it
- move.w (a2),d2
- andi.w #$3f,d2
- move.w (a3)+,d3
- andi.w #$ffc0,d3
- or.w d2,d3
- move.w d3,(a2)+
-
- ;; step around the next word to the beginning of the next line
- addq.l #2,a2
- addq.l #2,a3
-
- add.w _screenrem,a2
- add.w _screenrem,a3
-
- dbra d0,scrdupline
-
- ;;we skipped the next scan line (leading) when we did a scroll11
- ; add.w _screenbytes,a2
- ; add.w _screenbytes,a3
-
- move.l #11,d0 ;; # of scan lines to move, predecremented for dbra
-
- dbra d1,scrdupline
-
- add.l #2,a2 ;; un-correct screen shift
- jsr _clr11 ;; wants cleared regs, a2 = scan line to erase
-
- movem.l (sp)+,scrollregs ;; pop regs
-
- unlk a6
- rts
-
-
- _vtzapline:
- vtsavregs: reg d4-d7/a3/a4
- ; we use the superoptimized 3270 line drawer in a special case...
- ; we can be confident the font will not be reset because
- ; there are no 3270 attributes (# < 32) in an ASCII screen....\
-
- ; d3 = screen width in bytes
- ; a2 -> starting offset of line on physical screen
- ; a3 -> emulator character array
- ; a4 -> font
-
- link a6,#0
- movem.l vtsavregs,-(sp)
-
- move.l 8(a6),a3 ; a3 -> text
- move.l 12(a6),a2 ; a2 -> screen
-
- move.w _screenbytes,d3 ; d3 = width of screen
-
- tst.l 16(a6)
- bne.s vtzapcleared
-
- jsr _clr11 ; clear the line (preserves d3)
-
- vtzapcleared:
- add.w d3,a2
- add.w d3,a2 ; fix a2 for 9 point font routine; skip 2 lines
- move.l _thefont,a4 ; 0(a4) -> table 1 4(a4) -> table 2
- jsr zapline
-
- movem.l (sp)+,vtsavregs
- unlk a6
- rts
-
-